﻿function Regresar() {
    window.location.href = "ConsultaResultados.aspx?SetFilters=true";
    return false;
}

// Estas funciones estan en el control numeric, pero no se estan atachando. Razon: Los controles estan dentro de un repeater y un UC
function ValidNumber(txt, isValid) {
    if (isValid == 1) {
        if (!isNaN(txt.value)) {
            return true;
        }

        txt.value = "";
        alert("Numero invalido");
        txt.focus();
        return false;
    }

    return true;
}

function MaxNumber(txt, maxLen) {
    try {
        if (window.event.keyCode != 8 && window.event.keyCode != 9 && window.event.keyCode != 37 &&
            window.event.keyCode != 39 && window.event.keyCode != 46 && window.event.keyCode != 16 &&
            window.event.keyCode != 17 && window.event.keyCode != 33 && window.event.keyCode != 34 &&
            window.event.keyCode != 35 && window.event.keyCode != 36) {
            var currentNum = txt.value.length;
            if (currentNum > maxLen - 1)
                return false;
        }

        return true;
    }
    catch (e) {
        //alert(e.Description);
        return true;
    }
}

function MaxNumberChange(txt, maxLen) {
    try {
        var len = txt.value.length;
        if (len > maxLen - 1) {
            txt.value = txt.value.substring(0, maxLen);
        }

        return true;
    }
    catch (e) {
        //alert(e.Description);
        return true;
    }
}